<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
</html>

<script>
const school2205 = [
  { name: '恒奥03', age: 21, home: '淄博-3' },
  { name: '恒奥04', age: 21, home: '淄博-4' },
  { name: '恒奥05', age: 21, home: '淄博-5' },
  { name: '恒奥06', age: 21, home: '淄博-6' },
];

// Map   是 构造函数
  // 用法：new 构造函数 -> 返回实例对象。

// 初始化
const map = new Map([
  ['恒奥01', { name: '恒奥01', age: 21, home: '淄博-1' }]
]);

// 新增值：
map.set('恒奥02', { name: '恒奥02', age: 21, home: '淄博-2' });

// 循环 新增 map
school2205.forEach(item => {
  map.set(item.name, item);
})

console.log(map);
console.log(map.get('恒奥01'))  // -> ['恒奥01', { name: '恒奥01', age: 21, home: '淄博-1' }]

</script>